﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;

namespace Lottery.Client.SL.Controls
{
    
    public partial class BuyLottery : UserControl,IBuyLottery
    {
        private const int _int1 = 1000;
        private const int _int2 = 700;
        private const int _int3 = 4000;
        private bool _bool1;
        private bool _btnPostIsEnabled;
        private WinOpenInfo _winOpenInfo;
        private PlayDataInfo _playDataInfo;
        private WinTypeInfo _winTypeInfo;
        private ConfirmBetting _confirmBetting;
        private UserScaleInfo _userScaleInfo;
        private int _msgListChildrenCount;
        private double _double1;
        private bool _bool3;
        public IBuyLottery IBuy { get; set; }
        public ISystemMain ISM { get; set; }
        
        public BuyLottery()
		{
			this.InitializeComponent();
			this.IBuy = this;
			this._confirmBetting = new ConfirmBetting();
			this._confirmBetting.BetSucess += new EventHandler(this.OnBetSucess);
			this.btnAddNumber.MouseLeftButtonDown+=(new MouseButtonEventHandler(this.AddNumber));
			this.btnClearNubmer.MouseLeftButtonDown+=(new MouseButtonEventHandler(this.CleanNumber));
			this.btnBackpct.Click+=(new RoutedEventHandler(this.btnBackpct_Click));
			this.btnPost.Click+=(new RoutedEventHandler(this.fMG81MUH8L));
			this.HistoryGrid.SizeChanged+=(new SizeChangedEventHandler(this.SetGridViewClip));
            //App.app_client.UserScaleInfoChanged += new EventHandler(this.Ge3cv6CbsR);
            //App.app_client.InvestNumChanged += new EventHandler(this.vjZcbMs6hV);
            //App.app_client.GetMsgInfoCompleted += new ClientControl.RecvDataEventHandler(this.QHGcmpBRAX);
			base.Loaded+=(new RoutedEventHandler(this.ksecjUnlhZ));
			base.Unloaded+=(new RoutedEventHandler(this.XjI8FFluAm));
			this.listSelectedNumbers.SelectionChanged+=(new SelectionChangedEventHandler(this.o80cihJJl1));
            //选好的号的列表
			this.listSelectedNumbers.ItemsSource = (BetDataControl.BetDatas);
			this.SetMsg();
			double.TryParse(this.tbMultiple.Text, out this._double1);
			this.BuyDataGrid.ItemsSource = DataCache.CurrentDealStart;
			this.SetControlProperty();
		}
        [DebuggerNonUserCode]
        public void SetInterfaceValue(object obj)
        {
            this.ISM = (ISystemMain)obj;
        }
        private void o80cihJJl1(object obj, SelectionChangedEventArgs selectionChangedEventArgs)
        {
            BetDataControl.RemoveBetData(this.listSelectedNumbers.SelectedValue as BetData);
            this.uhncTlvTG9();
        }
        private void ksecjUnlhZ(object obj, RoutedEventArgs routedEventArgs)
        {
            this.OTHcdkmecI();
        }
        private void OnBetSucess(object obj, EventArgs eventArgs)
        {
            this.CleanNumber();
        }
        private void iP2cYPhXd0(object obj, EventArgs eventArgs)
        {
            bool t;
            this.btnPost.IsEnabled = (t = (this._winOpenInfo.CurrentBonusStatus == BonusStatus.StartBet));
            this._btnPostIsEnabled = t;
            this.SetSubmitEnabled(this._btnPostIsEnabled);
        }
        private void tbMultiple_TextChanged(object sender, TextChangedEventArgs e)
        {
            this.uhncTlvTG9();
        }
        private void Ge3cv6CbsR(object obj, EventArgs eventArgs)
        {
            this._userScaleInfo = DataCache.CurrentUserScaleInfo.GetUserScaleInfo(DataCache.CurrentPlayInfo.iScaleID);
            if (this._userScaleInfo == null)
            {
                return;
            }
            this.FeJ8VytMaJ();
        }
        private void QHGcmpBRAX(object obj, byte[] array)
        {
            this.SetMsg();
        }
        public void SetMsg()
        {
            this._msgListChildrenCount = this.msgList.Children.Count;
            if (this._msgListChildrenCount != 6)
            {
                if (MsgInfos.Infos == null || MsgInfos.Infos.Count < 1)
                {
                    return;
                }
                this.msg_mp3.Stop();
                bool flag = false;
                int num = 0;
                while (num < MsgInfos.Infos.Count && this._msgListChildrenCount < 6)
                {
                    if (MsgInfos.Infos[(num)].Title == "?")
                    {
                        for (int i = 0; i < this.msgList.Children.Count; i++)
                        {
                            DealMsg dealMsg = this.msgList.Children[i] as DealMsg;
                            if (dealMsg.lbTitle.Text == "?")
                            {
                                this.msgList.Children.RemoveAt(i);
                            }
                        }
                    }
                    else
                    {
                        flag = true;
                    }
                    MsgInfo mi = MsgInfos.Infos[num];
                    this.msgList.Children.Add(new DealMsg(mi));
                    this._msgListChildrenCount++;
                    MsgInfos.Infos.RemoveAt(num);
                }
                if (flag && DataCache.RealSound)
                {
                    this.msg_mp3.Play();
                }
            }
        }
        private void vjZcbMs6hV(object obj, EventArgs eventArgs)
        {
            this.lGScD2Mffk();
        }
        private void lGScD2Mffk()
        {
            this.tbSelectInvestNum.Text=("?" + DataCache.CurrentSchemeCache.InvestNum.ToString() + "?");
        }
        public void RefreshSubmit()
        {
            this.SetSubmitEnabled(this._btnPostIsEnabled);
        }
        private bool QmFc5UoPS7(ref int ptr, ref double ptr2, ref double ptr3, ref string ptr4, ref string ptr5)
        {
            bool result = false;
            if (this._playDataInfo.CurrentPlayData != null)
            {
                ptr = BetDataControl.InvestSumNum;
                ptr4 = BetDataControl.GetInvestSumCount();
                if (ptr < 1)
                {
                    ptr5 = "没有选择投注号码";
                    return result;
                }
                if (ptr > 1000)
                {
                    ptr5 = "?" + 1000 + "?";
                    return result;
                }
                if (string.IsNullOrEmpty(ptr4))
                {
                    ptr5 = "没有选择投注号码";
                    return result;
                }
                if (!this._bool3 && ptr4.Length > 4000)
                {
                    ptr5 = "?" + 4000 + "?";
                    return result;
                }
                int num = 0;
                int num2 = 0;
                if (this.mVmcZ85Qwn(ptr4, '&', ref num, ref num2))
                {
                    ptr5 = string.Concat(new string[]
					{
						"?",
						num.ToString(),
						"?",
						num2.ToString(),
						"?"
					});
                    return result;
                }
                this.SetSubmitEnabled(false);
                ptr3 = (double)ptr * ptr2;
                result = true;
            }
            else
            {
                ptr5 = "?";
            }
            return result;
        }
        private void GLOcr4JIMN(object obj, EventArgs eventArgs)
        {
            BetDataControl.ClearBetData();
            this.iP2cYPhXd0(null, null);
        }
        public void SetSubmitEnabled(bool isEnabled)
        {
            this.btnPost.IsEnabled=(isEnabled);
            if (isEnabled)
            {
                this.cbChase.IsEnabled=(true);
                this.cbChase.IsChecked=(new bool?(false));
                return;
            }
            this.cbChase.IsEnabled=(false);
        }
        private void cbChase_Checked(object sender, RoutedEventArgs e)
        {
            if (!double.TryParse(this.tbMultiple.Text, out this._double1) || this._double1 < 0.1)
            {
                this.cbChase.IsChecked=(new bool?(false));
                App.ShowMsg("倍数信息有误");
                return;
            }
            int num = 0;
            double num2 = 0.0;
            string tschemeCount = null;
            string msg = "";
            if (!this.QmFc5UoPS7(ref num, ref this._double1, ref num2, ref tschemeCount, ref msg))
            {
                this.cbChase.IsChecked=(new bool?(false));
                App.ShowMsg(msg);
                return;
            }
            if (this._bool3 && num > 700)
            {
                msg = "?" + 700 + "?";
                return;
            }
            AppendChase appendChase = new AppendChase();
            appendChase.Closed += new EventHandler(this.PPncHFO1NG);
            num = BetDataControl.InvestSumNum;
            appendChase.Show(DataCache.CurrentPlayInfo.LotteryID, DataCache.CurrentPlayInfo.PlayTypeID, num, this._double1, tschemeCount);
        }
        private void PPncHFO1NG(object obj, EventArgs eventArgs)
        {
            this.CleanNumber();
            this.iP2cYPhXd0(this, null);
        }
        private void SetGridViewClip(object obj, SizeChangedEventArgs sizeChangedEventArgs)
        {
            RectangleGeometry rectangleGeometry = new RectangleGeometry();
            Rect rect = default(Rect);
            rect.Width=(this.HistoryGrid.Width);
            rect.Height=(this.HistoryGrid.Height - 30.0);
            rectangleGeometry.Rect=(rect);
            this.GridView.Clip = (rectangleGeometry);
        }
        private void SetControlProperty()
        {
            this.AdjustControlHeight();
        }
        private void AdjustControlHeight()
        {
            double num = double.Parse(this.tbKeyBoardContent.GetValue(Canvas.TopProperty).ToString()) + this.tbKeyBoardContent.Height;
            this.ResultContent.SetValue(Canvas.TopProperty, num);
            double num2 = 616.0 - num - this.ResultContent.ActualHeight;
            if (this.tbKeyBoardContent.Height + num2 > 391.0)
            {
                num2 = 115.0;
            }
            this.HistoryGrid.Height=(num2);
            this.HistoryGrid.SetValue(Canvas.TopProperty, num + this.ResultContent.Height);
        }
        private void tbSchemeID_Click(object sender, MouseButtonEventArgs e)
        {
            TextBlock textBlock = sender as TextBlock;
            int num = PublicFunction.StrToInt32(textBlock.Tag.ToString());
            if (num > 0)
            {
                SchemeInfoWindow schemeInfoWindow = new SchemeInfoWindow();
                schemeInfoWindow.Show(num);
                return;
            }
            App.ShowMsg("?");
        }
        public void OpenChaseInfo()
        {
            if (!DataCache.CurrentPlayInfo.OpenChase)
            {
                this.cbChase.Visibility = Visibility.Collapsed;
                return;
            }
            this.cbChase.Visibility = Visibility.Visible;
        }
        private void CleanNumber(object obj, MouseButtonEventArgs mouseButtonEventArgs)
        {
            this.CleanNumber();
        }
        public void CleanNumber()
        {
            BetDataControl.ClearBetData();
            DataCache.CurrentSchemeCache.InvestNum = 0;
            DataCache.CurrentSchemeCache.InvestCount = "";
            this.uhncTlvTG9();
        }
        private void uhncTlvTG9()
        {
            this._double1 = PublicFunction.StrToDouble(this.tbMultiple.Text.Trim());
            int investSumNum = BetDataControl.InvestSumNum;
            this.rnSumInvestNum.Text=(investSumNum.ToString());
            this.rnSumMoney.Text=(((double)investSumNum * this._double1).ToString());
        }
        /// <summary>
        /// 选号
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="mouseButtonEventArgs"></param>
        //\\?
        private void AddNumber1(object obj, MouseButtonEventArgs mouseButtonEventArgs)
        {
            if (this._bool3)
            {
                if (!this.SelectNumber2())
                {
                    return;
                }
            }
            else
            {

                if (CulbViewMode.SelectGame.SelectGameMenu.SelectGameMode.PlayTypeName.Contains("复式") && DataCache.CurrentSchemeCache.InvestNum < 2)
                {
                    App.ShowMsg("复式号码必须大于一注！");
                    return;
                }
            }
            if (DataCache.CurrentSchemeCache.InvestNum > 0)
            {
                if (!this._bool3)
                {
                    BetDataControl.AddBetData(DataCache.CurrentSchemeCache.InvestNum, DataCache.CurrentSchemeCache.InvestCount, 380.0);
                   // App.app_client.ClearKeyBoard();
                }
                else
                {
                    string[] array = DataCache.CurrentSchemeCache.InvestCount.Split(new char[]
					{
						','
					});
                    string[] array2 = array;
                    for (int i = 0; i < array2.Length; i++)
                    {
                        string investCount = array2[i];
                        BetDataControl.AddBetData(1, investCount, 24.2);
                    }
                }
               // App.app_client.SetSelectInvestNum();
            }
            this.uhncTlvTG9();
        }
        private void AddNumber(object obj, MouseButtonEventArgs mouseButtonEventArgs)
        {
            if (this._bool3)
            {
                {
                    TextBox textBox = (TextBox)this.tbKeyBoardContent.Children[1];
                    string text = textBox.Text.Trim();
                    var numbers = text.Split(',');
                    int i = 0;
                    foreach (var number in numbers)
                    {
                        //if (i == numbers.Count()-1)
                        //    break;
                        BetDataControl.AddBetData(Convert.ToInt32(number), number, 24);
                        i++;
                    }
                    return;
                }
                //if (!this.SelectNumber2())
                //{
                //    return;
                //}
            }
            else
            {

                //if (CulbViewMode.SelectGame.SelectGameMenu.SelectGameMode.PlayTypeName.Contains("复式") && DataCache.CurrentSchemeCache.InvestNum < 2)
                //{
                //    App.ShowMsg("复式号码必须大于一注！");
                //    return;
                //}
            }
            //if (DataCache.CurrentSchemeCache.InvestNum > 0)
            //{
                if (!this._bool3)
                {
                    BetDataControl.AddBetData(DataCache.CurrentSchemeCache.InvestNum, DataCache.CurrentSchemeCache.InvestCount, 380.0);
                    // App.app_client.ClearKeyBoard();
                }
                else
                {
                    string[] array = DataCache.CurrentSchemeCache.InvestCount.Split(new char[]
					{
						','
					});
                    string[] array2 = array;
                    for (int i = 0; i < array2.Length; i++)
                    {
                        string investCount = array2[i];
                        BetDataControl.AddBetData(1, investCount, 24.2);
                    }
                }
                // App.app_client.SetSelectInvestNum();
            //}
            this.uhncTlvTG9();
        }
        private bool mVmcZ85Qwn(string text, char c, ref int ptr, ref int ptr2)
        {
            string[] array = text.Split(new char[]
			{
				c
			});
            bool flag = false;
            ptr = 0;
            ptr2 = 0;
            int num = 0;
            while (num < array.Length && !flag)
            {
                for (int i = num + 1; i < array.Length; i++)
                {
                    if (array[num] == array[i])
                    {
                        ptr = num + 1;
                        ptr2 = i + 1;
                        flag = true;
                        break;
                    }
                }
                num++;
            }
            return flag;
        }
        private bool SelectNumber2()
        {
            bool result = false;
            TextBox textBox = (TextBox)this.tbKeyBoardContent.Children[1];
            string text = textBox.Text.Trim();
            if (!string.IsNullOrEmpty(text))
            {
                string text2 = null;
                int num = 0;
                int num2 = 0;
                int num3 = PublicFunction.CheckSingleNumber(text, ref num2, ref text2, ref num);
                if (num3 != 0)
                {
                    //\\?
                    textBox.Select(num3 * num2 + num3 - 3, num2 + 1);
                    App.ShowMsg("?" + num3.ToString() + "?");
                }
                else
                {
                    if (num > 0 && !string.IsNullOrEmpty(text2))
                    {
                        result = true;
                        DataCache.CurrentSchemeCache.InvestNum = num;
                        DataCache.CurrentSchemeCache.InvestCount = text2;
                        textBox.Text=("");
                    }
                }
            }
            else
            {
                App.ShowMsg("请输入投注内容！");
            }
            return result;
        }
        private void OTHcdkmecI()
        {
            if (CulbViewMode.SelectGame == null)
            {
                CulbViewMode.SelectGame = CulbViewMode.GameKind.Games[0];
                this.SetGameMenu();
            }
        }
        private bool PFqc07LPhD(int num, ref int ptr)
        {
            bool result = false;
            using (List<PlayTypeInfo>.Enumerator enumerator = PlayTypeInfoControl._PlayTypeInfo.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    PlayTypeInfo current = enumerator.Current;
                    if (current.ID == num)
                    {
                        result = true;
                        ptr = current.WinTypeID;
                        break;
                    }
                }
            }
            return result;
        }
        private void GameModeRbChecked(object obj, RoutedEventArgs routedEventArgs)
        {
            this.CleanNumber();
            this.lGScD2Mffk();
            RadioButton radioButton = (RadioButton)obj;
            string text = radioButton.DataContext.ToString();
            if (!string.IsNullOrEmpty(text))
            {
                int num = Convert.ToInt32(DataCache.CurrentPlayInfo.LotteryID + text);
                if (text == "?"|| text == "?" || text == "?" || text == "?")
                {
                    int num2 = 0;
                    if (!this.PFqc07LPhD(num, ref num2))
                    {
                        App.ShowMsg("此玩法正在维护中,请稍后再试!");
                        return;
                    }
                    DataCache.CurrentPlayInfo.iScaleID = num2;
                    this._winTypeInfo = WinTypeInfoControl.GetLotteryWinTypeInfo(num2);
                    this.FeJ8VytMaJ();
                }
                this.ChangeGameModelEleRbStyle();
                this.SetSelectedRbStyle((RadioButton)obj);
                CulbViewMode culbViewMode = new CulbViewMode();
                this._bool3 = culbViewMode.CreateKeyboard(this.tbKeyBoardContent);
                DataCache.CurrentPlayInfo.PlayTypeID = text;
                DataCache.CurrentPlayInfo.iPlayTypeID = num;
                DataCache.CurrentPlayInfo.PlayName = radioButton.Content.ToString();
                this.AdjustControlHeight();
                return;
            }
            App.ShowMsg("此玩法正在维护中,请稍后再试!");
        }
        private void FeJ8VytMaJ()
        {
            if (this._winTypeInfo == null)
            {
                return;
            }
            if (this._winTypeInfo.ScaleType == 0)
            {
                this._userScaleInfo = null;
                string text = (this._winTypeInfo.Scale > 100.0) ? "?" : ((this._winTypeInfo.Scale > 10.0) ? "?" : "?");
                this.lbBonus.Text=((this._winTypeInfo.Scale * 2.0).ToString(text));
                this.lbScale.Text=(this._winTypeInfo.Scale.ToString(text));
                this.lbBackPct.Text=(DataCache.CurrentUserInfo.BackPct.ToString());
                this.btnBackpct.IsEnabled=(false);
                return;
            }
            if (this._winTypeInfo.ScaleType == 1)
            {
                this._userScaleInfo = DataCache.CurrentUserScaleInfo.GetUserScaleInfo(DataCache.CurrentPlayInfo.iScaleID);
                if (this._userScaleInfo != null)
                {
                    this.btnBackpct.IsEnabled=(true);
                    string text2 = (this._userScaleInfo.Scale > 100.0) ? "?" : ((this._userScaleInfo.Scale > 10.0) ? "?" : "?");
                    this.lbBonus.Text=((this._userScaleInfo.Scale * 2.0).ToString(text2));
                    this.lbScale.Text=(this._userScaleInfo.Scale.ToString());
                    this.lbBackPct.Text=(this._userScaleInfo.BackPct.ToString());
                    return;
                }
                App.ShowMsg("用户赔率获取失败!");
            }
        }
        private void dij8QuAOom()
        {
            this.CvWinDataPanel.Children.Clear();
            if (DataCache.CurrentPlayInfo.LotteryID > 0)
            {
                this._playDataInfo = PlayDataControl.GetPlayDataInfo(DataCache.CurrentPlayInfo.LotteryID);
                if (this._playDataInfo != null)
                {
                    this._winOpenInfo = new WinOpenInfo();
                    this._winOpenInfo.Init(this._playDataInfo);
                    this._winOpenInfo.BonusStatusChanged += new EventHandler(this.iP2cYPhXd0);
                    this.CvWinDataPanel.Children.Add(this._winOpenInfo);
                }
            }
        }
        public void SetGameMenu()
        {
            this.dij8QuAOom();
            this.GameMenuContent.Children.Clear();
            for (int i = 0; i < CulbViewMode.SelectGame.GamesMenu.Count; i++)
            {
                TextBlock textBlock = new TextBlock();
                textBlock.Tag = (i);
                textBlock.TextAlignment = (0);
                textBlock.MouseLeftButtonDown+=(new MouseButtonEventHandler(this.GameMenuEleSelected));
                textBlock.Text=(CulbViewMode.SelectGame.GamesMenu[i].TypeName);
                textBlock.FontSize=(13.5);
                textBlock.SetValue(Canvas.LeftProperty, (double)i * 82.0);
                this.GameMenuContent.Children.Add(textBlock);
            }
            this.C908XLis6A();
            this.ChangeSelectedGameMenuEleTbStyle((TextBlock)this.GameMenuContent.Children[0]);
            this.SetGameModelContent();
        }
        private void SetGameModelContent()
        {
            //设定玩法模式相关控件及样式 rb
            this.GameModelContent.Children.Clear();
            CulbViewMode culbViewMode = new CulbViewMode();
            this._bool3 = culbViewMode.CreateKeyboard(this.tbKeyBoardContent);
            for (int i = 0; i < CulbViewMode.SelectGame.SelectGameMenu.GameModes.Count; i++)
            {
                RadioButton radioButton = new RadioButton();
                radioButton.Click+=(new RoutedEventHandler(this.GameModeRbChecked));
                radioButton.Tag=(i);
                radioButton.DataContext=(CulbViewMode.SelectGame.SelectGameMenu.GameModes[i].PlayTypeID);
                radioButton.Content=(CulbViewMode.SelectGame.SelectGameMenu.GameModes[i].PlayTypeName);
                radioButton.FontSize=(11.0);
                radioButton.SetValue(Canvas.LeftProperty, 20.0 + (double)i * 105.0);
                this.GameModelContent.Children.Add(radioButton);
                if (i == 0)
                {
                    radioButton.IsChecked=(new bool?(true));
                    DataCache.CurrentPlayInfo.PlayTypeID = radioButton.DataContext.ToString();
                    DataCache.CurrentPlayInfo.PlayName = CulbViewMode.SelectGame.SelectGameMenu.GameModes[0].PlayTypeName;
                    int iPlayTypeID = Convert.ToInt32(DataCache.CurrentPlayInfo.LotteryID + DataCache.CurrentPlayInfo.PlayTypeID);
                    DataCache.CurrentPlayInfo.iPlayTypeID = iPlayTypeID;
                }
            }
            int num = Convert.ToInt32(DataCache.CurrentPlayInfo.LotteryID.ToString() + CulbViewMode.SelectGame.SelectGameMenu.TypeID.ToString());
            DataCache.CurrentPlayInfo.iScaleID = num;
            this._winTypeInfo = WinTypeInfoControl.GetLotteryWinTypeInfo(num);
            this.ChangeGameModelEleRbStyle();
            this.SetSelectedRbStyle((RadioButton)this.GameModelContent.Children[0]);
            this.FeJ8VytMaJ();
            this.SetControlProperty();
        }
        private void SetSelectedRbStyle(RadioButton radioButton)
        {
            radioButton.Style = ((Style) base.Resources["SelectRadioButtonStyle1"]);
            if (radioButton.Content.ToString().Length > 5)
            {
                this.SelectModel.Width=((double)(radioButton.Content.ToString().Length * 18));
            }
            else
            {
                this.SelectModel.Width=((double)radioButton.Content.ToString().Length * 22.5);
            }
            this.SelectModel.SetValue(Canvas.LeftProperty, double.Parse(radioButton.GetValue(Canvas.LeftProperty).ToString()));
            CulbViewMode.SelectGame.SelectGameMenu.SelectGameMode = CulbViewMode.SelectGame.SelectGameMenu.GameModes[int.Parse(radioButton.Tag.ToString())];
        }
        private void ChangeGameModelEleRbStyle()
        {
            for (int i = 0; i < this.GameModelContent.Children.Count; i++)
            {
                RadioButton radioButton = (RadioButton)this.GameModelContent.Children[i];
                radioButton.Style=((Style)base.Resources["RadBtnStyle"]);
            }
        }
        private void GameMenuEleSelected(object obj, MouseButtonEventArgs mouseButtonEventArgs)
        {
            this.CleanNumber();
            this.lGScD2Mffk();
            this.C908XLis6A();
            TextBlock textBlock = (TextBlock)obj;
            this.ChangeSelectedGameMenuEleTbStyle(textBlock);
            this.SetGameModelContent();
        }
        private void ChangeSelectedGameMenuEleTbStyle(TextBlock textBlock)
        {
            int num = int.Parse(textBlock.Tag.ToString());
            //\\?
            //textBlock.Style = ((Style)base.Resources["SelectRadioButtonStyle1"]);
            textBlock.SetValue(Canvas.TopProperty, 2.0);
            this.SelectGameItem.SetValue(Canvas.LeftProperty, 120.0 + double.Parse(textBlock.GetValue(Canvas.LeftProperty).ToString()) - (80.0 - textBlock.ActualWidth) / 2.0);
            CulbViewMode.SelectGame.SelectGameMenu = CulbViewMode.SelectGame.GamesMenu[num];
            CulbViewMode.SelectGame.SelectGameMenu.SelectGameMode = CulbViewMode.SelectGame.SelectGameMenu.GameModes[0];
        }
        private void C908XLis6A()
        {
            for (int i = 0; i < this.GameMenuContent.Children.Count; i++)
            {
                TextBlock textBlock = (TextBlock)this.GameMenuContent.Children[i];
                //\\?
                //  textBlock.Style=((Style)base.Resources.get_Item(BcZJxKMIDcH0kvSFls.w4WekCpilj(5674)));
                textBlock.SetValue(Canvas.TopProperty, 4.0);
            }
        }
        private void fMG81MUH8L(object obj, RoutedEventArgs routedEventArgs)
        {
            if (this._double1 <= 0.0)
            {
                App.ShowMsg("倍数信息有误");
                return;
            }
            int sumInvestNum = 0;
            double sumMoney = 0.0;
            string betCount = null;
            string msg = "";
            if (this.QmFc5UoPS7(ref sumInvestNum, ref this._double1, ref sumMoney, ref betCount, ref msg))
            {
                this._confirmBetting.IBuy = this;
                this._confirmBetting.Closed += new EventHandler(this.GLOcr4JIMN);
                this._confirmBetting.ShowBetMsg(this._playDataInfo.CurrentPlayData.IsuseID, this._playDataInfo.CurrentPlayData.IsusesName, DataCache.CurrentPlayInfo.LotteryID, DataCache.CurrentPlayInfo.PlayTypeID, DataCache.CurrentPlayInfo.PlayName, sumInvestNum, this._double1, sumMoney, betCount);
                return;
            }
            App.ShowMsg(msg);
        }
        private void btnBackpct_Click(object obj, RoutedEventArgs routedEventArgs)
        {
            if (this._userScaleInfo == null)
            {
                return;
            }
            SetRewards setRewards = new SetRewards();
            setRewards.InitSlider(DataCache.CurrentPlayInfo.iScaleID, this._userScaleInfo.Scale, this._userScaleInfo.BackPct, this._winTypeInfo.ScaleBase);
            setRewards.Show();
        }
        private void XjI8FFluAm(object obj, RoutedEventArgs routedEventArgs)
        {
            return;
            //if (App.app_client != null)
            //{
            //    if (this._winOpenInfo != null)
            //    {
            //        this._winOpenInfo.BonusStatusChanged -= new EventHandler(this.iP2cYPhXd0);
            //    }
            //    App.app_client.UserScaleInfoChanged -= new EventHandler(this.Ge3cv6CbsR);
            //    App.app_client.InvestNumChanged -= new EventHandler(this.vjZcbMs6hV);
            //    App.app_client.GetMsgInfoCompleted -= new ClientControl.RecvDataEventHandler(this.QHGcmpBRAX);
            //}
        }
    }
}
